
#include "Graphics/Configuration.hpp"

using namespace	Graphics;

namespace	Graphics
{
	int unsigned const	DefaultWidth		= 800;
	int unsigned const	DefaultHeight		= 600;
	int unsigned const	DefaultColor		= 24;
	std::string const	DefaultTitle		= "Game";
	std::string const	DefaultIcon			= "";
	bool const			DefaultWindowed		= true;
	bool const			DefaultVSync		= false;
	int unsigned const	DefaultFrameRate	= 70;
}


Configuration::Configuration(int unsigned w, int unsigned h, int unsigned c,
						  std::string const &title,
						  bool type) : _width(w), _height(h), _color(c),
											 _title(title), _icon(DefaultIcon), _type(type),
											 _vSync(DefaultVSync), _frameRate(DefaultFrameRate)
{
}
Configuration::Configuration(Configuration const &conf) : _width(conf._width), _height(conf._height), _color(conf._color),
														  _title(conf._title), _icon(conf._icon), _type(conf._type),
														  _vSync(conf._vSync), _frameRate(conf._frameRate)
{
}


Configuration const	&Configuration::operator=(Configuration const &conf)
{
	if (this != &conf)
	{
		this->_width = conf._width;
		this->_height = conf._height;
		this->_color = conf._color;
		this->_title = conf._title;
		this->_icon = conf._icon;
		this->_type = conf._type;
		this->_vSync = conf._vSync;
		this->_frameRate = conf._frameRate;
	}

	return (*this);
}


int unsigned		Configuration::getWidth() const throw()
{
	return this->_width;
}
int unsigned		Configuration::getHeight() const throw()
{
	return this->_height;
}
int unsigned		Configuration::getColor() const throw()
{
	return this->_color;
}
std::string const	&Configuration::getTitle() const throw()
{
	return this->_title;
}
std::string const	&Configuration::getIcon() const throw()
{
	return this->_icon;
}
bool				Configuration::getWindowed() const throw()
{
	return this->_type;
}
bool				Configuration::getVSync() const throw()
{
	return this->_vSync;
}
int unsigned		Configuration::getFrameRate() const throw()
{
	return this->_frameRate;
}

void				Configuration::setWidth(int unsigned w)
{
	this->_width = w;
}
void				Configuration::setHeight(int unsigned h)
{
	this->_height = h;
}
void				Configuration::setSize(int unsigned w, int unsigned h)
{
	this->_width = w;
	this->_height = h;
}
void				Configuration::setColor(int unsigned c)
{
	this->_color = c;
}
void				Configuration::setTitle(std::string const &t)
{
	this->_title = t;
}
void				Configuration::setIcon(std::string const &i)
{
	this->_icon = i;
}
void				Configuration::setWindowed(bool t)
{
	this->_type = t;
}
void				Configuration::setVSync(bool vs)
{
	this->_vSync = vs;
}
void				Configuration::setFrameRate(int unsigned f)
{
	this->_frameRate = f;
}

Configuration::~Configuration() throw()
{
}
